package br.com.lacibMusic.rn;

import br.com.lacibMusic.entidades.GeneroMusical;
import br.com.lacibMusic.dao.GenericDAO;
import br.com.lacibMusic.dao.GeneroMusicalDAO;
import java.util.List;

public class GeneroMusicalRN {

    private final GenericDAO dao = new GenericDAO();
    private final GeneroMusicalDAO generoMusicalDao = new GeneroMusicalDAO();

    public GeneroMusical novo() {
        return new GeneroMusical();
    }

    public boolean salvar(GeneroMusical c) {
        if (c.getId() == null) {
            return dao.criar(c);
        } else {
            return dao.alterar(c);
        }
    }

    public boolean remover(GeneroMusical c) {
        return dao.excluir(c);
    }

    public GeneroMusical obter(Integer id) {
        return (GeneroMusical) dao.obter(GeneroMusical.class, id);
    }

    public List<GeneroMusical> obterTodos() {
        return dao.obterTodos(GeneroMusical.class);
    }
    
    
    public List<GeneroMusical> obterPorNome(String nome) {
        return generoMusicalDao.obterPorNome(GeneroMusical.class, nome);
    }
}
